/** 初始化题目类型*/
export const questionTypes = {
    1: '多选题',
    2: '单选题',
    3: '比重题',
    4: '文本题',
    7: '下拉框',
    5: '单位选择下拉框',
    6: '专业选择下拉框',
};
/** 根据题目类型初始化答案格式*/
export const initQuestionAnswer = (v) => {
    let type = v.type
    switch (type) {
        case 1:
            // 多选题的答案组成
            return {
                type: type,
                answer: [],
            }
        case 2:
            return {
                type: type,
                answer: -1,
            }
        case 3:
            let init = []
            let content = JSON.parse(v.content)
            content.forEach(() => {
                init.push(0)
            })
            return {
                type: type,
                answer: init,
            }
        case 4:
            return {
                type: type,
                answer: "",
            }
        case 5:
            return {
                type: type,
                answer: "",
            }
        case 6:
            return {
                type: type,
                answer: [],
            }
        case 7:
            return {
                type: type,
                answer: -1,
            }
    }
};
